﻿using System;
using System.Windows.Data;
using Scrabble.Model;
using Scrabble.Properties;

namespace Scrabble.Controls
{
    public class ScoringStyleToStringConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string result = null;

            if (value is ScoringStyle)
            {
                var style = (ScoringStyle)value;

                switch (style)
                {
                    case ScoringStyle.LetterOnly:
                        break;

                    case ScoringStyle.DoubleLetter:
                        result = Resources.Scoring_DoubleLetter;
                        break;

                    case ScoringStyle.TripleLetter:
                        result = Resources.Scoring_TripleLetter;
                        break;

                    case ScoringStyle.DoubleWord:
                        result = Resources.Scoring_DoubleWord;
                        break;

                    case ScoringStyle.TripleWord:
                        result = Resources.Scoring_TripleWord;
                        break;
                }
            }

            return result;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}